package com.junhao.service;

import com.spring.Autowried;
import com.spring.Component;
import com.spring.InitializingBean;
import com.spring.Scope;

@Component("orderService")
@Scope("prototype")
public class OrderService implements InitializingBean {
    @Autowried
    UserService userService;

    private String beanName;
    // OrderService类的@Component("orderService")获取到的"orderService"如何赋值给此参数
    // implements BeanNameAware 实现接口

    public void test(){
        System.out.println(userService);
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("初始化");
    }

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }
}
